<template>
  <div class="container">
    <img :src="src" alt="">
  </div>
</template>

<script>
export default {
  name: 'show',
  components: {},
  data() {
    return {
      src: ''
    }
  },
  mounted() {
    this.setImgSrc()
  },
  watch: {
    '$route.path': function (to, from) {
      this.setImgSrc()
    }
  },
  methods: {
    setImgSrc() {
      const { path } = this.$route
      const tempArr = path.split('/')
      this.src = `http://10.221.18.11:9972/scene/images/${tempArr[tempArr.length - 1]}.png`
    }
  }
}
</script>

<style lang="less" scoped>
  .container {
    img {
      display: block;
      width: 100%;
    }
  }
</style>
